<template>
  <div style="display: flex;flex-direction: column;align-items: center;">
    <canvas ref="canvas" width="150px" height="200px" style="width: 300px;height: 400px;border: 1px solid #999;"></canvas>
    <!-- <div style="margin-top: 22px;width: 80%;">
        <el-button @click="restfinger">重新采集</el-button>
    </div> -->
  </div>
</template>

<script>
import finger from './index.js';
export default {
    props:['autographPath'],
    data(){
        return {
            canvas:null,
            imgObj:null,
        }
    },
    methods:{
        restfinger(){
            finger.cancelRegister()
            // this.canvas.getContext('2d').drawImage(this.imgObj,0,0,this.canvas.width ,this.canvas.height);
            finger.pullFingerFile()
        },
        commit(){
            return finger.serveImgPng()
            // if(finger.serveImgPng()){
            // }
            // return null
        }
    },
    mounted(){
        this.canvas = this.$refs.canvas
        // this.imgObj = new Image()
        // this.imgObj.src = this.autographPath
        // this.imgObj.onload = ()=>{
        //     var ctx=this.canvas.getContext("2d");	
        //     ctx.drawImage(this.imgObj,0,0,this.canvas.width ,this.canvas.height);
        // }
        finger.getWebServerInfo(this.canvas)
    },
    beforeDestroy(){
        finger.cancelRegister()
    }
}
</script>

<style>

</style>